<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width='device-width', initial-scale=1.0">
    <title>Document</title>

    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
</head>
<body>
    <div class="root">
        <h1>今天天气很{{info}}</h1>
        <br>
        <button @click="change()">change</button>
    </div>
    
</body>
<script>
    new Vue({
        el:".root",
        data:{
            weather:false
        },
        computed:{
            info:{
                get(){
                    return this.weather?"晴":"阴"
                }
            }
        },
        methods: {
            change(){
                this.weather=!this.weather
            }
        },
       
    })
</script>
</html>